package com.hy.main.demo.stream;

import java.util.Arrays;
import java.util.List;
import java.util.Optional;

/**
 * @Author yang DongYong
 * @Date 2023/4/13 - 04 - 13 - 21:52
 * @Description: com.hy.main.demo.stream
 * @version: 1.0
 */
public class Demo {
    public static void main(String[] args) {
        List<Integer> list = Arrays.asList(1, 2, null, 4, 5, 6);
        List<Integer> list02 = Arrays.asList(1, 2, 3, 4, 5, 6);
        List<List<Integer>> lists = Arrays.asList(list, list02);
        list.stream().map(e -> Optional.ofNullable(e).orElse(999)).forEach(System.out::println);

    }
}
